// 引入封装好的接口
import { cateList } from '../../../request/api'

const state = {
    cateList: []
}

const getters = {
    getCateList(state) {
        return state.cateList
    }
}

const mutations = {
    REQ_CATELIST(state, payload) {
        state.cateList = payload
    }
}

const actions = {
    async changeCateAction({ commit }) {
        let res = await cateList({
            istree: 1
        })
        console.log(res,'响应');
        commit('REQ_CATELIST', res.list)
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    //命名空间
    namespaced: true,
}